#include <bits/stdc++.h>
using namespace std;
int main()
{
    freopen("duel.in","r",stdin);
    freopen("duel.out","w",stdout);
    int n,a[100000],c=0;
    memset(a,0,sizeof(a));
    cin>>n;
    for(int i=1;i<=n;i++)
    {
        cin>>a[i];
    }
    for(int i=1;i<=2;i++)
    {
        for(int i=0;i<n;i++)
        {
            if(a[i]>a[i+1])
                swap(a[i],a[i+1]);
        }
    }
    for(int i=1;i<=n;i++)
    {
        if (a[i]==a[i+1])
        {
            a[i]=0;
            c=c+1;
        }
    }
    cout<<c;
    fclose(stdin);
    fclose(stdout);
    return 0;
}
